{extend name="base" /}
{block name="body"}
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">列表</li>
            <!--<li class=""><a href="{:url('admin/user/index')}">用户列表</a></li>-->
            <!-- <li class=""><a href="{:url('admin/skin/add')}">添加轮播图</a></li> -->
        </ul>
        <form class="layui-form layui-form-pane" action="{:url('index/adminmsg/index3')}" method="get">
            <div class="layui-inline">
                <label class="layui-form-label">数据库id</label>
                <div class="layui-input-inline">
                    <input type="text" name="sqlid" value="{$sqlid}" placeholder="请输入数据库" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">关键词</label>
                <div class="layui-input-inline">
                    <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">类型</label>
                <div class="layui-input-inline">
                    <input type="text" name="type" value="{$type}" placeholder="请输入关键词" class="layui-input">
                </div>
            </div>

            <div class="layui-inline">
                <button class="layui-btn">搜索</button>
            </div>
        </form>

        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form action="" method="post" class="ajax-form">
                    <button type="button" class="layui-btn layui-btn-small ajax-action" data-action="{:url('index/adminmsg/local_save_oss',['sqlid'=>$sqlid])}">上传OSS</button>
                    <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('index/adminmsg/delete_locals',['sqlid'=>$sqlid])}">删除本地文件</button>
                    <button type="button" class="layui-btn layui-btn-danger layui-btn-small ajax-action" data-action="{:url('index/adminmsg/delete_local_array',['sqlid'=>$sqlid])}">逐个删除本地文件</button>
                    <div class="layui-tab-item layui-show">
                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                                <th>操作</th>
                                <th style="width: 30px;">域名路径</th>
                                <th style="width: 30px;">是否上传oss</th>
                                <th>oss图片</th>
                                <th>客服id</th>
                                <th>内容</th>
                                <th>发送时间</th>
                                <th>聊天类型</th>
                                <th>appid</th>
                                <th>发送人</th>
                                <th>组长id</th>

                            </tr>
                            </thead>
                            <tbody>
                            {foreach name="msg_list" item="vo"}
                            <tr>
                                <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                                <td>
                                    <a href="{:url('index/adminmsg/local_save_one',['id'=>$vo['id'],'sqlid'=>$sqlid])}" class="layui-btn layui-btn-normal layui-btn-mini">添加OSS</a>
                                    <a href="{:url('index/adminmsg/delete_local',['id'=>$vo['id'],'sqlid'=>$sqlid])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除本地文件</a>
                                </td>
                                <td>{$vo.content}</td>
                                <td>{$vo.oss_name}</td>
                                <td>
                                    {$vo.oss_url}
                                </td>
                                <td>{$vo.cs_id}</td>
                                <td>
                                    {$vo.content}
                                </td>
                                <td>{$vo.send_time}</td>
                                <td>{$vo.type}</td>
                                <td>{$vo.appid}</td>
                                <td>{php}echo $vo['send_type']==1002 ? '客服' : '客户';{/php}</td>
                                <td>{$vo.pid}</td>

                            </tr>
                            {/foreach}
                            </tbody>
                            {$pages->render();}
                        </table>
                        {$pages->render();}
                    </div>
                </form>
            </div>
        </div>
        {/block}

        {block name="script"}
        <script>
            $('.content').mousemove(function(){
                $(this).next('img').css('display','block');
            });

            $('.content').mouseout(function(){
                $(this).next('img').css('display','none');
            });

            $('.oss_url').mousemove(function(){
                $(this).next('img').css('display','block');
            });

            $('.oss_url').mouseout(function(){
                $(this).next('img').css('display','none');
            });
        </script>
        {/block}
